<?php
/**
 * Created by PhpStorm.
 * User: xsp
 * Date: 2018/5/8
 * Time: 13:00
 */

namespace frontend\models;


use yii\db\ActiveRecord;

class OrderDetail extends ActiveRecord
{

    public function rules()
    {
        return [
            [['productid', 'productnum', 'price', 'orderid', 'createtime'],'required'],
        ];
    }

    public function add($data)
    {
        if ($this->load($data)&&$this->save())
        {
            return true;
        }
        return false;
    }
}